package net.csdn.business.notify.feign.config;

import net.csdn.business.notify.feign.aspect.SecurityInnerAspect;
import net.csdn.business.notify.feign.config.properties.FeignAuthProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.http.HttpServletRequest;

/**
 * @ClassName SecurityConfig
 * @Description TODO
 * @Author zhangyl
 * @Date 2023/5/11 11:34
 */

@Configuration
@EnableConfigurationProperties(value = FeignAuthProperties.class)
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
public class SecurityConfig {

    @Bean
    public SecurityInnerAspect securityInnerAspect(HttpServletRequest request, FeignAuthProperties feignAuthConfig){
        return new SecurityInnerAspect(request,feignAuthConfig);
    }
}
